webrtc wpt: add missing pc.close during cleanup running the html.js/codemod-peerconnection-addcleanup from the tools directory showed some places where a pc.close was missing BUG=836871 Change-Id: I135db200a4269eccfafc43217b66584603101434 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1610767 Commit-Queue: Philipp Hancke <philipp.hancke@googlemail.com> Reviewed-by: Henrik Boström <hbos@chromium.org> Cr-Commit-Position: refs/heads/master@{#661283} 
diff --git a/webrtc/RTCCertificate-postMessage.html b/webrtc/RTCCertificate-postMessage.html index 5885f9f..ee8347c 100644 --- a/webrtc/RTCCertificate-postMessage.html +++ b/webrtc/RTCCertificate-postMessage.html 
@@ -42,9 +42,10 @@  iframe.contentWindow.postMessage(certificate, "*");  let certificate2 = await promise;   - new RTCPeerConnection({certificates: [certificate]}); - - new RTCPeerConnection({certificates: [certificate2]}); + const pc1 = new RTCPeerConnection({certificates: [certificate]}); + t.add_cleanup(() => pc1.close()); + const pc2 = new RTCPeerConnection({certificates: [certificate2]}); + t.add_cleanup(() => pc2.close());    assert_equals(certificate.expires, certificate2.expires);  for (let fingerprint of certificate2.getFingerprints()) 
diff --git a/webrtc/RTCDataChannel-send.html b/webrtc/RTCDataChannel-send.html index 76d3524..4565a83 100644 --- a/webrtc/RTCDataChannel-send.html +++ b/webrtc/RTCDataChannel-send.html 
@@ -300,6 +300,7 @@    promise_test(async t => {  let pc1 = new RTCPeerConnection(); + t.add_cleanup(() => pc1.close());  let [channel1, channel2] = await createDataChannelPair(pc1);  let message = 'hello888'; // 8 bytes  while (message.length <= pc1.sctp.maxMessageSize) { 
diff --git a/webrtc/RTCIceTransport-extension.https.html b/webrtc/RTCIceTransport-extension.https.html index 206a4bb..94beb99 100644 --- a/webrtc/RTCIceTransport-extension.https.html +++ b/webrtc/RTCIceTransport-extension.https.html 
@@ -98,7 +98,7 @@  iceTransport.gather({});  let candidate;  do { - ({ candidate } = await watcher.wait_for('icecandidate')); + (({ candidate } = await watcher.wait_for('icecandidate')));  } while (candidate !== null);  assert_equals(iceTransport.gatheringState, 'gathering');  await watcher.wait_for('gatheringstatechange'); 
diff --git a/webrtc/RTCPeerConnection-setLocalDescription.html b/webrtc/RTCPeerConnection-setLocalDescription.html index 2becbd3..c4671c3 100644 --- a/webrtc/RTCPeerConnection-setLocalDescription.html +++ b/webrtc/RTCPeerConnection-setLocalDescription.html 
@@ -125,6 +125,7 @@    promise_test(async t => {  const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close());  const offer = await pc.createOffer();  let eventSequence = '';  const signalingstatechangeResolver = new Resolver(); 
diff --git a/webrtc/RTCRtpParameters-transactionId.html b/webrtc/RTCRtpParameters-transactionId.html index 472b043..eb98a83 100644 --- a/webrtc/RTCRtpParameters-transactionId.html +++ b/webrtc/RTCRtpParameters-transactionId.html 
@@ -63,6 +63,7 @@  */  promise_test(async t => {  const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close());  const { sender } = pc.addTransceiver('audio');  await doOfferAnswerExchange(t, pc);   @@ -73,7 +74,6 @@  validateSenderRtpParameters(param2);    assert_not_equals(param1.transactionId, param2.transactionId); -  }, `sender.getParameters() should return different transaction IDs for each call`);    /*